package edu.gatech.wms.junits;


import java.util.ArrayList;
import java.util.List;
import java.util.Locale;

import org.junit.BeforeClass;
import org.junit.Test;

import android.graphics.Bitmap;
import android.location.Address;
import android.test.AndroidTestCase;
import edu.gatech.wms.controllers.ItemManager;
import edu.gatech.wms.models.FoundItem;
import edu.gatech.wms.models.ItemType;

public class TestCreateItem extends AndroidTestCase{

	
	
	
	public void testcreateItem() {
	
		String name = "Puppy";
		ItemType type = new FoundItem();
		int id = 10;
		int ownerId = 5;
		String description = "woof!";
		Bitmap image = null;
		Address loc = new Address(null);
		ArrayList<String> categories = new ArrayList<String>();
		categories.add("toy");
		//Item newItem = new Item(name,type, id, description, image, ownerId, loc, categories);
		//System.out.println("name: " + newItem.getName(), "Type: " + newItem.getType(), "Description: "+ newItem.getDescription(), "ID" + newItem.getId(), "Address" + newItem.getAddress(), "Categories: " + newItem.getCategories() );
		
		// create item
		ItemManager.createItem(name,type, id, description, image, ownerId, loc, categories);
		
		//create another item
		
		String nameTest = ItemManager.getItemName(id);
		ItemType typeTest = ItemManager.getItemType(id);
		String descriptionTest = ItemManager.getItemDescription(id);
		Bitmap imageTest = ItemManager.getItemImage(id);
		int ownerIdTest = ItemManager.getItemOwnerId(id);
		Address locTest = ItemManager.getLocation(id);
		List categoriesTest = ItemManager.getItemCategories(id);
		
		
		assertTrue(null==null);
		assertTrue(name.equals(nameTest));
		assertTrue(type instanceof FoundItem); 								
		assertTrue(description.equals(descriptionTest));
		assertTrue(image==imageTest);
		assertTrue(ownerId==ownerIdTest);
		assertTrue(categories.toString().equals(categoriesTest.toString())); 					
		
	}

}
